﻿<!--***************************************************************************************

   Toolkit for WPF

   Copyright (C) 2007-2016 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  *************************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views.ThemingAvalonDockView"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
                xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                xmlns:s="clr-namespace:System;assembly=mscorlib"
                xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views"
                xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
                Title="Theming AvalonDock"
                x:Name="_demo">
   <local:DemoView.Description>
      <Paragraph FontSize="14"
                 FontFamily="Segoe">
         <Run>Changes the themes of the AvalonDock controls. Available themes are System, Aero, VS2010, Metro, Office2007, and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
            <LineBreak />
            <Run>Some features of this sample are only available in the "Plus" version.</Run>
            <LineBreak />
            <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
               Click here for more details about Xceed Toolkit Plus for WPF.
            </Hyperlink>
      </Paragraph>
   </local:DemoView.Description>

   <local:DemoView.Resources>


      <Style x:Key="plusSuffix" TargetType="TextBlock">
          <Setter Property="Margin" Value="5,0,0,0"/>
          <Setter Property="Text" Value="Plus Only"/>
          <Setter Property="FontStyle" Value="Italic"/>
          <Setter Property="FontSize" Value="8"/>
          <Setter Property="BaselineOffset" Value="7"/>
          <Setter Property="Foreground" Value="#06b025"/>
          <Style.Triggers>
            <DataTrigger Binding="{Binding IsHighlighted, RelativeSource={RelativeSource AncestorType={x:Type ComboBoxItem}}}" Value="True">
                <Setter Property="Foreground" Value="White"/>
            </DataTrigger>
          </Style.Triggers>
      </Style>

      <Style x:Key="plusItem"
             TargetType="ComboBoxItem">
         <Setter Property="HorizontalContentAlignment"
                 Value="Stretch" />
         <Setter Property="ContentTemplate">
            <Setter.Value>
               <DataTemplate>
                  <DockPanel>
                     <TextBlock DockPanel.Dock="Left"
                                Text="{Binding}" />
                     <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
                  </DockPanel>
               </DataTemplate>
            </Setter.Value>
         </Setter>
      </Style>
   </local:DemoView.Resources>

   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
         <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>

      <GroupBox Header="Features"
                Grid.Row="0"
                Margin="5">
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" />
               <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <StackPanel Orientation="Horizontal"
                        Margin="5">
               <TextBlock Text="Theme:"
                          Margin="0,0,10,0"
                          VerticalAlignment="Center" />
               <ComboBox x:Name="_themeCombo"
                         SelectedIndex="0"
                         Width="160"
                         Height="25">
                  <view:AvalonDockComboBoxItem Content="Generic"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Generic}"/>
                  <view:AvalonDockComboBoxItem Content="Aero"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Aero}">
                     <view:AvalonDockComboBoxItem.Tag>
                        <xcad:AeroTheme />
                     </view:AvalonDockComboBoxItem.Tag>
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem Content="VS2010"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.VS2010}">
                     <view:AvalonDockComboBoxItem.Tag>
                        <xcad:VS2010Theme />
                     </view:AvalonDockComboBoxItem.Tag>
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem Content="Metro"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Metro}">
                     <view:AvalonDockComboBoxItem.Tag>
                        <xcad:MetroTheme />
                     </view:AvalonDockComboBoxItem.Tag>
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
                                               Content="Office2007 Black"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}">
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
                                               Content="Office2007 Blue"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}">
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
                                               Content="Office2007 Silver"
                                               Selected="DefaultComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}">
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem"
                                               Style="{StaticResource plusItem}"
                                               Content="Metro Dark"
                                               Selected="MetroComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.MetroDark}">
                     <!--MetroDark Theme is set in CodeBehind-->
                  </view:AvalonDockComboBoxItem>
                  <view:AvalonDockComboBoxItem x:Name="metroLightComboBoxItem"
                                               Style="{StaticResource plusItem}"
                                               Content="Metro Light"
                                               Selected="MetroComboBoxItem_Selected"
                                               ThemeEnum="{x:Static view:AvalonDockThemesEnum.MetroLight}">
                     <!--MetroLight Theme is set in CodeBehind-->
                  </view:AvalonDockComboBoxItem>
               </ComboBox>
            </StackPanel>


         </Grid>
      </GroupBox>

      <TextBlock Grid.Row="1"
                 Text="Usage:"
                 Style="{StaticResource Header}" />

      <Border x:Name="SampleBorder"
              Grid.Row="2">
         <xcad:DockingManager x:Name="_dockingManager"
                              MaxHeight="395"
                              AllowMixedOrientation="True"
                              BorderBrush="Black"
                              BorderThickness="1"
                              Theme="{Binding ElementName=_themeCombo, Path=SelectedItem.Tag}">
            <xcad:DockingManager.DocumentHeaderTemplate>
               <DataTemplate>
                  <StackPanel Orientation="Horizontal">
                     <Image Source="{Binding IconSource}"
                            Margin="0,0,4,0" />
                     <TextBlock Text="{Binding Title}" />
                  </StackPanel>
               </DataTemplate>
            </xcad:DockingManager.DocumentHeaderTemplate>
            <xcad:LayoutRoot x:Name="_layoutRoot">
               <xcad:LayoutPanel Orientation="Horizontal">
                  <xcad:LayoutAnchorablePane DockWidth="200">
                     <xcad:LayoutAnchorable ContentId="properties"
                                            Title="Properties"
                                            CanHide="False"
                                            CanClose="False"
                                            AutoHideWidth="240"
                                            IconSource="../Images/property-blue.png">
                        <xctk:PropertyGrid NameColumnWidth="110"
                                           SelectedObject="{Binding ElementName=_layoutRoot, Path=LastFocusedDocument.Content}"
                                           AutoGenerateProperties="False">
                           <xctk:PropertyGrid.PropertyDefinitions>
                              <xctk:PropertyDefinition TargetProperties="Background" />
                              <xctk:PropertyDefinition TargetProperties="BorderBrush" />
                              <xctk:PropertyDefinition TargetProperties="BorderThickness" />
                              <xctk:PropertyDefinition TargetProperties="FontSize" />
                              <xctk:PropertyDefinition TargetProperties="FontStyle" />
                              <xctk:PropertyDefinition TargetProperties="Width" />
                              <xctk:PropertyDefinition TargetProperties="Height" />
                           </xctk:PropertyGrid.PropertyDefinitions>
                        </xctk:PropertyGrid>
                     </xcad:LayoutAnchorable>
                  </xcad:LayoutAnchorablePane>
                  <xcad:LayoutDocumentPaneGroup>
                     <xcad:LayoutDocumentPane>
                        <xcad:LayoutDocument ContentId="document1"
                                             Title="Document 1"
                                             IconSource="../Images/document.png">
                           <Button Content="Document 1 Content"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center" />
                        </xcad:LayoutDocument>
                        <xcad:LayoutDocument ContentId="document2"
                                             Title="Document 2"
                                             IconSource="../Images/document.png">
                           <TextBox Text="Document 2 Content"
                                    AcceptsReturn="True" />
                        </xcad:LayoutDocument>
                     </xcad:LayoutDocumentPane>
                  </xcad:LayoutDocumentPaneGroup >
                  <xcad:LayoutAnchorablePaneGroup DockWidth="125">
                     <xcad:LayoutAnchorablePane>
                        <xcad:LayoutAnchorable ContentId="alarms"
                                               Title="Alarms"
                                               IconSource="../Images/alarm-clock-blue.png">
                           <ListBox>
                              <s:String>Alarm 1</s:String>
                              <s:String>Alarm 2</s:String>
                              <s:String>Alarm 3</s:String>
                           </ListBox>
                        </xcad:LayoutAnchorable>
                        <xcad:LayoutAnchorable ContentId="journal"
                                               Title="Journal">
                           <RichTextBox>
                              <FlowDocument>
                                 <Paragraph FontSize="14"
                                            FontFamily="Segoe">
                                    This is the content of the Journal Pane.
                                    <LineBreak />
                                    A
                                    <Bold>RichTextBox</Bold> has been added here
                                 </Paragraph>
                              </FlowDocument>
                           </RichTextBox>
                        </xcad:LayoutAnchorable>
                     </xcad:LayoutAnchorablePane>
                  </xcad:LayoutAnchorablePaneGroup>
               </xcad:LayoutPanel>

               <xcad:LayoutRoot.LeftSide>
                  <xcad:LayoutAnchorSide>
                     <xcad:LayoutAnchorGroup>
                        <xcad:LayoutAnchorable Title="Agenda"
                                               ContentId="agenda"
                                               IconSource="../Images/address-book-open.png">
                           <TextBlock Text="Agenda Content"
                                      Margin="10"
                                      FontSize="18"
                                      FontWeight="Black"
                                      TextWrapping="Wrap" />
                        </xcad:LayoutAnchorable>
                        <xcad:LayoutAnchorable Title="Contacts"
                                               ContentId="contacts"
                                               IconSource="../Images/address-book--pencil.png">
                           <TextBlock Text="Contacts Content"
                                      Margin="10"
                                      FontSize="18"
                                      FontWeight="Black"
                                      TextWrapping="Wrap" />
                        </xcad:LayoutAnchorable>
                     </xcad:LayoutAnchorGroup>
                  </xcad:LayoutAnchorSide>
               </xcad:LayoutRoot.LeftSide>
            </xcad:LayoutRoot>
         </xcad:DockingManager>
      </Border>

      <Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" Visibility="Collapsed" />
      <StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed">
            <TextBlock Text="This theme is only available in the &quot;Plus&quot; version. "/>
            <TextBlock>
               <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
                  Click here for more details about Xceed Toolkit Plus for WPF.
               </Hyperlink>
            </TextBlock>
      </StackPanel>
   </Grid>
</local:DemoView>
